/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entidades;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author rafrau
 */
@Entity
@Table(name = "usr", catalog = "idlbbd", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Usr.findAll", query = "SELECT u FROM Usr u"),
    @NamedQuery(name = "Usr.findByIdUsr", query = "SELECT u FROM Usr u WHERE u.idUsr = :idUsr"),
    @NamedQuery(name = "Usr.findByNomUsr", query = "SELECT u FROM Usr u WHERE u.nomUsr = :nomUsr"),
    @NamedQuery(name = "Usr.findByApeUsr", query = "SELECT u FROM Usr u WHERE u.apeUsr = :apeUsr"),
    @NamedQuery(name = "Usr.findByNuUsr", query = "SELECT u FROM Usr u WHERE u.nuUsr = :nuUsr"),
    @NamedQuery(name = "Usr.findByFnacUsr", query = "SELECT u FROM Usr u WHERE u.fnacUsr = :fnacUsr"),
    @NamedQuery(name = "Usr.findByEmailUsr", query = "SELECT u FROM Usr u WHERE u.emailUsr = :emailUsr"),
    @NamedQuery(name = "Usr.findByIdIdlb", query = "SELECT u FROM Usr u WHERE u.idIdlb = :idIdlb"),
    @NamedQuery(name = "Usr.findByPssUsr", query = "SELECT u FROM Usr u WHERE u.pssUsr = :pssUsr")})
public class Usr implements Serializable {
    private static final long serialVersionUID = 1L;
    @Basic(optional = false)
    @Column(name = "id_usr", nullable = false)
    private int idUsr;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "nom_usr", nullable = false, length = 50)
    private String nomUsr;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "ape_usr", nullable = false, length = 50)
    private String apeUsr;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "nu_usr", nullable = false, length = 50)
    private String nuUsr;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fnac_usr", nullable = false)
    @Temporal(TemporalType.DATE)
    private Date fnacUsr;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "email_usr", nullable = false, length = 50)
    private String emailUsr;
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_idlb", nullable = false)
    private int idIdlb;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "pss_usr", nullable = false, length = 50)
    private String pssUsr;

    public Usr() {
    }

    public Usr(String nomUsr) {
        this.nomUsr = nomUsr;
    }

    public Usr(String nomUsr, int idUsr, String apeUsr, String nuUsr, Date fnacUsr, String emailUsr, int idIdlb, String pssUsr) {
        this.nomUsr = nomUsr;
        this.idUsr = idUsr;
        this.apeUsr = apeUsr;
        this.nuUsr = nuUsr;
        this.fnacUsr = fnacUsr;
        this.emailUsr = emailUsr;
        this.idIdlb = idIdlb;
        this.pssUsr = pssUsr;
    }

    public int getIdUsr() {
        return idUsr;
    }

    public void setIdUsr(int idUsr) {
        this.idUsr = idUsr;
    }

    public String getNomUsr() {
        return nomUsr;
    }

    public void setNomUsr(String nomUsr) {
        this.nomUsr = nomUsr;
    }

    public String getApeUsr() {
        return apeUsr;
    }

    public void setApeUsr(String apeUsr) {
        this.apeUsr = apeUsr;
    }

    public String getNuUsr() {
        return nuUsr;
    }

    public void setNuUsr(String nuUsr) {
        this.nuUsr = nuUsr;
    }

    public Date getFnacUsr() {
        return fnacUsr;
    }

    public void setFnacUsr(Date fnacUsr) {
        this.fnacUsr = fnacUsr;
    }

    public String getEmailUsr() {
        return emailUsr;
    }

    public void setEmailUsr(String emailUsr) {
        this.emailUsr = emailUsr;
    }

    public int getIdIdlb() {
        return idIdlb;
    }

    public void setIdIdlb(int idIdlb) {
        this.idIdlb = idIdlb;
    }

    public String getPssUsr() {
        return pssUsr;
    }

    public void setPssUsr(String pssUsr) {
        this.pssUsr = pssUsr;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nomUsr != null ? nomUsr.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Usr)) {
            return false;
        }
        Usr other = (Usr) object;
        if ((this.nomUsr == null && other.nomUsr != null) || (this.nomUsr != null && !this.nomUsr.equals(other.nomUsr))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidades.Usr[ nomUsr=" + nomUsr + " ]";
    }
    
}
